package fristphase.day02;

import java.util.Scanner;

public class 猜数字小游戏While {
    public static void main(String[] args) {
        int num = (int)(Math.random()*1000+1);
        Scanner scanner = new Scanner(System.in);
        System.out.println(num);
        int guess = scanner.nextInt();
        while (guess != num){
            if(guess>num){
                System.out.println("太大了！");
            }else{
                System.out.println("太小了！");
            }
            guess = scanner.nextInt();
        }
        System.out.println("你猜对了");
    }
}
